//
//  PersonInfoTableViewCell.m
//  Inforcollection
//
//  Created by macbook on 15/12/10.
//  Copyright © 2015年 oceansoft.liw. All rights reserved.
//

#import "PersonInfoTableViewCell.h"

@implementation PersonInfoTableViewCell

- (void)awakeFromNib {
    // Initialization code

    [self initCellAttribute];
}
//设置cell的基本属性
- (void)initCellAttribute
{
    self.infoTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    
    self.infoTextField.returnKeyType = UIReturnKeyDone;
    
    self.infoTextField.delegate = self;
    self.infoTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
    
    self.backgroundColor = [UIColor colorWithRed:232.0/255.0 green:232.0/255.0 blue:232.0/255.0 alpha:1.0];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    //text的边框设置为没有
    self.infoTextField.borderStyle = UITextBorderStyleNone;
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField{
    
    [self.infoTextField resignFirstResponder];
    
    return YES;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.infoTextField resignFirstResponder];
}

+ (instancetype)changeInfoWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"InfoCellID";
    PersonInfoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"PersonInfoTableViewCell" owner:nil options:nil] firstObject];
    }
    return cell;

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
